<?php

/**
 * PaymentChecks filter form base class.
 *
 * @package    erpcrm
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BasePaymentChecksFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'bank_initials'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'account_number' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'check_number'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'check_date'     => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'check_amount'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'bank_initials'  => new sfValidatorPass(array('required' => false)),
      'account_number' => new sfValidatorPass(array('required' => false)),
      'check_number'   => new sfValidatorPass(array('required' => false)),
      'check_date'     => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'check_amount'   => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('payment_checks_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'PaymentChecks';
  }

  public function getFields()
  {
    return array(
      'payment_iden'   => 'ForeignKey',
      'check_iden'     => 'Text',
      'bank_initials'  => 'Text',
      'account_number' => 'Text',
      'check_number'   => 'Text',
      'check_date'     => 'Date',
      'check_amount'   => 'Number',
    );
  }
}
